﻿namespace DM4Script
{
    /// <summary>
    /// functions for error handling
    /// </summary>
    public partial class ScriptParse
    {
        /// <summary>
        /// small helper functions for error handling
        /// </summary>
        /// <param name="str">error string</param>
        /// <returns>prototype</returns>
        private Prototypes.ExprAst Error(string str)
        {
            Logs.Add(new Prototypes.Log(true, str, _numberLine, _tokenNumSymbolInLineStart, _numberSymbolStart, _numberCurrentSymbol));
            return null;
        }

        private Prototypes.DeclareSection ErrorDeclare(string str)
        {
            Error(str);
            return null;
        }

        private Prototypes.ScriptTask ErrorTask(string str)
        {
            Error(str);
            return null;
        }

        private Prototypes.RunSection ErrorRun(string str)
        {
            Error(str);
            return null;
        }
    
        private Prototypes.TaskRun ErrorTaskRun(string str)
        {
            Error(str);
            return null;
        }
    }
}
